from hfc.fabric_ca.caservice import ca_service

casvc = ca_service(target="http://127.0.0.1:7054")
identityService = casvc.newIdentityService()

admin = casvc.enroll("admin", "adminpw")  # now local will have the admin user
secret = identityService.create(admin, 'foo')  # create user foo
res = identityService.getOne('foo', admin)  # get user foo
res = identityService.getAll(admin)  # get all users
res = identityService.update('foo', admin, maxEnrollments=3,
                             affiliation='.', enrollmentSecret='bar')  # update user foo
res = identityService.delete('foo', admin)  # delete user foo
